import request from '@/utils/request'

// 登录接口
export const Login = data => {
    return request({
        url: '/admin/system/index/login',
        method: 'post',
        data: data,
    })
}

// 获取验证码
export const GetValidateCode = () => {
    return request({
        url: '/admin/system/index/generateValidateCode',
        method: 'get',
    })
}

// 获取登录用户信息
export const GetUserinfo = () => {
    return request({
        url: '/admin/system/index/getUserInfo', // 请求后端的接口地址，后期需要将其更改为
        method: 'get',
    })
}

// 退出功能
export const Logout = () => {
    return request({
        url: '/admin/system/index/logout',
        method: 'get',
    })
}

export const UpdatePassword = (oldPassword, newPassword) => {
    return request({
        url: '/admin/system/index/updatePassword/' + oldPassword + '/' + newPassword,
        method: 'put',
    })
}

export const RestartSysUserPassword = (username, mobile, code) => {
    return request({
        url: '/admin/system/index/restartPassword/' + username + '/' + mobile + '/' + code,
        method: 'put'
    })
}